<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{ $app_name }}</title>
    <link rel="stylesheet" href="invite/layer.css">
    <script src="invite/jquery.min.js"></script>
    <script src="invite/layer.js"></script>
    <link rel="stylesheet" href="invite/layer(1).css" id="layuicss-layer">
    <script src="https://g.alicdn.com/jssdk/u-link/index.min.js"></script>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        .box {
            box-sizing: border-box;
        }

        .mask {
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            position: absolute;
            top: 0;
            z-index: 9999999;
        }

        .tips {
            width: 95%;
            margin: auto;
            position: relative;
        }

        .tips > img {
            width: 50%;
            position: absolute;
            top: 5px;
            right: 0;
        }

        #xiazai {
            width: 100%;
            height: 100vh;
            position: absolute;
            top: 0px;
            left: 0px;
            background: none;
            border: none;
        }

        body {
            position: relative !important;
        }
    </style>
</head>


<body style="background: url({{ url('invite/app.png') }}) 0% 0% / 100vw 100vh no-repeat;">
<div class="box">
    <div class="mask" style="display: none;">
        <div class="tips">
            <div></div>
            <img src="invite/tips.png" alt="">
        </div>
    </div>
</div>
<button id="xiazai"></button>
<script type="text/javascript">
    ULink([
        {
            id: "{{ $ulinkid }}",
            data: {
                cid: '{{ $cid }}',
                pid: '{{ $uuid }}',
                group: '{{ $group_invite }}'
            },
            selector: "#xiazai",

            useOpenInBrowerTips: "default",
            proxyOpenDownload: function (defaultAction, LinkInstance){
                if (LinkInstance.solution.type === "scheme"){
                    // qq或者微信环境特殊处理下
                    if (ULink.isWechat || ULink.isQQ) {
                        // 在qq或者微信环境执行内置逻辑，具体内置逻辑为:当设置了useOpenInBrowerTips字段时，qq&&微信&&scheme时，启用蒙层提示去浏览器打开
                        defaultAction();
                    }else{
                        window.location.href = LinkInstance.solution.downloadUrl;
                    }
                }else if(LinkInstance.solution.type === "universalLink"){
                    // universalLink 唤起应当由服务端提供一个带重定向到appstore的universallink地址。因此，此处不应写逻辑，友盟已于6月2日上线universalLink生成及重定向功能。
                }
            },
        },
    ]);

    /*const download_app_url = '{{ $download_app_url }}'
    const height = $(document).height()
    if (isWeiXin()) {
        $('.mask').css('height', height).show()
    } else {
        $('.mask').hide()
    }

    function isWeiXin() {
        var ua = window.navigator.userAgent.toLowerCase()
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            return true
        } else {
            return false
        }
    }

    function download() {
        if (isWeiXin()) {
            $('.mask').show()
        } else {
            window.location.href = download_app_url
        }
    }*/
</script>


</body>
</html>
